<?php
include(ANYROOT.'include/page.class.php');
$cid=getcateidbyname($cateId);
$cnname=getinfo($cid,'name','categories');
$enname=getinfo($cid,'englishname','categories');
$total=getcount("SELECT `essay_id`FROM ".tbname("essay")." WHERE essay_status='pub' AND essay_categoryid='$cid'");
$url="./?cate-$cateId-$id";
$prepage=4;
$page=$classPage;
$p=new Page2($total,$url,$page,$prepage);
$offset=($page-1)*$prepage;
$pgtitle=$cnname.'-';
?>
<?php include("header.php"); ?>
	<div id="layout">
<?php include("sidebar.php"); ?>
		<div class="main main_line">
			<div class="news_location">
				您现在的位置：
				<a href="../">青年网</a> &gt; <a href="./">青年资讯</a> &gt; <a href="./?class-<?=$enname?>.htm"><?=$cnname?></a>
			</div>
			<div class="news_class">
<?php
    $sql="SELECT * FROM ".tbname('categories')."  WHERE `categories_parentid`='$cid' ORDER BY categories_sort ASC LIMIT 0,8";
     $res = $_ANYGLOBAL['db']->query($sql);
    if($res){
	$row=$_ANYGLOBAL['db']->getall($res);
    foreach($row as $list){
		$catename=$list['categories_name'];
		$cateenname=$list['categories_englishname'];
		if(substr($cateenname,0,7) != 'http://'){
		?>
		<p class="list_cate"><a href="./?class-<?=$cateenname?>.htm" ><?=$catename?></a></p>
						<ul>
							<?=listnewsbycid($list['categories_id'],60,$prepage,'[m-d]','no',$offset)?>
						</ul>
						<div class="clear"></div>
	<?php	} }	} ?>				
			</div>

			<div class="news_page">
				
			</div>
		</div>
<?php include("footer.php"); ?>
